import React, { Component } from 'react';
import {
    View,
    FlatList,
    Image,
    StyleSheet
} from 'react-native';
import Constant from '../../constant/Constants';
import TopBar from '../../component/TopBar';
/**
 * 消息
 */
export default class MessagePage extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <View style={Style.container}>
                <TopBar title='消息中心' showBack={true} onBackPress={() => {
                    this.props.navigation.pop();
                }} />
                <FlatList
                    data={[
                        { key: 0, icon: require('../../img/icon_wechat_small_secretary.png'), title: '车辆动态1', subtitle: '点评申诉结果通知' },
                        { key: 1, icon: require('../../img/icon_wechat_small_secretary.png'), title: '车辆动态2', subtitle: '点评申诉结果通知' },
                        { key: 2, icon: require('../../img/icon_wechat_small_secretary.png'), title: '车辆动态3', subtitle: '点评申诉结果通知' },
                        { key: 3, icon: require('../../img/icon_wechat_small_secretary.png'), title: '车辆动态4', subtitle: '点评申诉结果通知' },
                        { key: 4, icon: require('../../img/icon_wechat_small_secretary.png'), title: '车辆动态5', subtitle: '点评申诉结果通知' },
                        { key: 5, icon: require('../../img/icon_wechat_small_secretary.png'), title: '车辆动态6', subtitle: '点评申诉结果通知' },
                        { key: 6, icon: require('../../img/icon_wechat_small_secretary.png'), title: '车辆动态7', subtitle: '点评申诉结果通知' }
                    ]}
                    renderItem={this.renderItem}

                />
            </View>
        );
    }

    renderItem = ({ item, index }) => {
        return (
            <View key={item.title} style={{ flexDirection: 'row', height: 45 }}>
                <Image source={item.icon} style={{ width: 45, height: 45, resizeMode: Image.resizeMode.center }} />
            </View>
        );
    }

}

const Style = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: Constant.COLOR.ColorWhite
    }
});

